<!DOCTYPE html>
<html>
    
<?php
/**
 * Description of Theme_Roller_Admin:
 * This code implements the functionality that allows the administrator to
 * an application's look and feel
 *
 * @author Malekgene Rantho
 * Date: 22 May 2011
 * 
 */
   
//Include ThemeInterface definition and implementation
 include ('ThemeInterface.php');
 
 //Create a reference to the class that manipulates the theme name stored in the
 //theme name xml file
 $theme_Interface = new ThemeInterface();
 
 //Create a variable and read theme name into it
 $variable = $theme_Interface->getThemeName();
 
 //load the css template of the selected theme
 echo '<head>';
      echo  "<link rel = 'stylesheet'  href='/testxmlSonia/css/$variable/jquery-ui-1.8.12.custom.css' type='text/css' >";
 echo '<head>';
       
?>
  
 <body>
 <!--Create a drop-down menu to select application theme-->     
 <form action ="" method ="POST">
     <tr>
         <td>
            Template    
         </tr>
     <tr>
     <tr>
         <td>
<select name="template">
<option value="1">Black-Tie</option>
<option value="2">Blitzer</option>
<option value="3">Cupertino</option>
<option value="4">Dark-Hive</option>
<option value="5">Dot-Luv</option>
<option value="6">Eggplant</option>
<option value="7">Excite-bike</option>
<option value="8">Flick</option>
<option value="9">Hot-sneaks</option>
<option value="10">Humanity</option>
<option value="11">Le-frog</option>
<option value="12">Mint-Choc</option>
<option value="13">Overcast</option>
<option value="14">Pepper-grinder</option>
<option value="15">Redmond</option>
<option value="16">Smoothness</option>
<option value="17">South-Street</option>
<option value="18">Start</option>
<option value="19">Sunny</option>
<option value="20">Swanky-Purse</option>
<option value="21">Trantastic</option>
<option value="22">UI-Darkness</option>
<option value="23">UI-Lightness</option>
<option value="24">Vader</option>
</select>
         <td>    
     </tr>
     <tr>
         <td>
         <input type="Submit" value ="Save Changes">
         </td>
     </tr>
 </form>
 </body>
 </html>
 
 <html>
 <body>
     
    <?php   
     /*
      * Use switch stamement to recall the selected theme
      * 
      */

    
   switch ($_POST['template']) {
        case 1:
           $theme = "black-tie";
           break;
        case 2:
           $theme = "blitzer";
           break;
        case 3:
           $theme = "cupertino";
           break;
        case 4:
           $theme= "dark-hive";
           break;
        case 5:
          $theme = "dot-luv";
           break;
        case 6:
          $theme = "eggplant";
           break;
        case 7:
           $theme = "excite-bike";
           break;
        case 8:
           $theme = "flick";
           break;
        case 9:
           $theme = "hot-sneaks";
           break;
        case 10:
           $theme = "humanity";
           break;
        case 11:
           $theme = "le-frog";
           break;
        case 12:
           $theme= "mint-choc";
           break;
        case 13:
           $theme = "overcast";
           break;
        case 14:
           $theme = "pepper-grinder";
           break;
        case 15:
           $theme = "redmond";
           break;
        case 16:
           $theme = "smoothness";
           break;
        case 17:
           $theme = "south-street";
           break;
        case 18:
           $theme = "start";
           break;
        case 19:
           $theme = "sunny";
           break;
        case 20:
           $theme = "swanky-purse";
           break;
        case 21:
           $theme = "trantastic";
           break;
        case 22:
           $theme = "ui-darkness";
           break;
        case 23:
           $theme = "ui-lightness";
           break;
        case 24:
           $theme = "vader";
           break;

   }
   
   
   //Alter the theme name in the theme xml file and reload page  
   $theme_Interface->setThemeName($theme)
 
?>
        
       
    </body>
</html>
